#!/usr/bin/env python
# coding: utf-8

# In[3]:


# 1. FaceSet Create
import requests,json
api_secret = "iLY5Ph11UBwuTDtMWNO-N6CWXVIhK3aq"
api_key = "TsR0nqQ0T_AB7NRmT4WuayCNwsVeOYXx"
display_name = "网新一班人脸集合"
outer_id = "0579"
user_data = "52人，20男生，32女生"
CreateFace_Url = "https://api-cn.faceplusplus.com/facepp/v3/faceset/create"
payload = {
    'api_key': api_key,
    'api_secret': api_secret,
    'display_name':display_name,
    'outer_id':outer_id,
    'user_data':user_data
}
r = requests.post(CreateFace_Url, params=payload)


# In[4]:


r.json()


# In[5]:


GetDetail_Url = "https://api-cn.faceplusplus.com/facepp/v3/faceset/getdetail"
payload = {
    'api_key': api_key,
    'api_secret': api_secret,
    'outer_id':outer_id,
}
r = requests.post(GetDetail_Url,params=payload)
r.json()


# In[8]:


AddFace_url = " https://api-cn.faceplusplus.com/facepp/v3/faceset/addface"
payload = {
    'api_key': api_key,
    'api_secret': api_secret,
    'faceset_token':'5f7f9eac8e7746d2903fd81daa416657',
    'face_token': 'b0407b9e803ebd39d511cd7956fd5bf5',
}
r = requests.post(AddFace_url,params=payload)
r.json()


# In[7]:


RemoveFace_url = " https://api-cn.faceplusplus.com/facepp/v3/faceset/removeface"

payload = {
    'api_key': api_key,
    'api_secret': api_secret,
    'faceset_token':'5f7f9eac8e7746d2903fd81daa416657',
    'face_tokens':'b0407b9e803ebd39d511cd7956fd5bf5',
}
r = requests.post(RemoveFace_url,params=payload)
r.json()


# In[9]:


Update_url = "https://api-cn.faceplusplus.com/facepp/v3/faceset/update"

payload = {
    'api_key': api_key,
    'api_secret': api_secret,
    'faceset_token':'5f7f9eac8e7746d2903fd81daa416657',
    'user_data':"53人，21男生，32女生",
}


# In[10]:


r = requests.post(Update_url,params=payload)
r.json()


# In[11]:


liudehua01 = "https://gss0.baidu.com/9fo3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/7c1ed21b0ef41bd57f7f20ff57da81cb39db3d89.jpg"
liudehua02 = "https://tse3-mm.cn.bing.net/th/id/OIP.Xz3HbYZeNrdUnGJ7vXNzsQHaKO?pid=Api&rs=1"
wangzulan = "https://tse3-mm.cn.bing.net/th/id/OIP.ZnXeGoVYT4jQudiPOGZn3QAAAA?pid=Api&rs=1"


# In[12]:


Compare_url = "https://api-cn.faceplusplus.com/facepp/v3/compare"

payload ={
    'api_key': api_key,
    'api_secret': api_secret,
    'image_url1':liudehua01,
    'image_url2':wangzulan
}


# In[13]:


r = requests.post(Compare_url,params=payload)
r.json()


# In[ ]:




